Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add scramble flag for development text scrambling #745

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jb55
Copy link
Contributor

@jb55 jb55 commented Feb 22, 2025

Inspired by @danieldaquino 's change in damus iOS...

This commit introduces a new scramble option to help reduce distractions during development by scrambling text using rot13. When enabled via the new --scramble flag, text displayed in various views is transformed, making it easier to focus on layout and behavior without reading the actual content.

App & Args Updates

  • Added a scramble: bool field to the main application state (in app.rs).

  • Extended argument parsing (in args.rs) to recognize the --scramble flag.

NoteOptions Enhancement

  • Introduced a new bit flag scramble_text in NoteOptions with corresponding setter/getter methods.

UI Adjustments

  • Propagated the scramble flag through note rendering functions across navigation, timeline, and note view modules.

  • Updated several UI components (e.g., in nav.rs, route.rs, and contents.rs) to accept and apply the new note options.

Rot13 Implementation

  • Implemented a helper function (rot13) to scramble text conditionally when the scramble option is enabled.

This feature is intended for development builds only, offering a way to obscure text content during UI tweaks and testing.

jb55 added 2 commits February 22, 2025 14:30
This commit introduces a new scramble option to help reduce distractions
during development by scrambling text using rot13. When enabled via the
new `--scramble` flag, text displayed in various views is transformed,
making it easier to focus on layout and behavior without reading the
actual content.

App & Args Updates

  - Added a `scramble: bool` field to the main application state (in `app.rs`).

  - Extended argument parsing (in `args.rs`) to recognize the `--scramble` flag.

NoteOptions Enhancement

  - Introduced a new bit flag `scramble_text` in `NoteOptions` with
    corresponding setter/getter methods.

UI Adjustments

  - Propagated the scramble flag through note rendering functions across
    navigation, timeline, and note view modules.

  - Updated several UI components (e.g., in `nav.rs`, `route.rs`, and
    `contents.rs`) to accept and apply the new note options.

Rot13 Implementation

  - Implemented a helper function (`rot13`) to scramble text
    conditionally when the scramble option is enabled.

This feature is intended for development builds only, offering a way to
obscure text content during UI tweaks and testing.

Signed-off-by: William Casarin <[email protected]>
- Introduced a new "no_media" boolean in ColumnsArgs to capture the
  --no-media flag.

- Updated NoteOptions to include a setting for hiding media, configured
  from parsed arguments.

- Refactored Damus to consolidate note options (textmode, scramble, and
  no-media) into a single NoteOptions field.

- Modified navigation UI rendering to pass the unified note_options.

This change allows users to disable media display via the --no-media flag.

Signed-off-by: William Casarin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant